home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / misc / unix / sploinerppc.lha / sploinerppc / sploiner.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-04  |  1.6 KB  |  68 lines

  1. /* Copyright: Richard Joergensen                             */
  2. /* Internet: ric@daimi.aau.dk (at last until summer 1995)    */
  3. /* Disclaimer: I take NO responsibilities for this program.  */
  4. /* Any use is on your own risk.                              */
  5. /* PowerUP and WarpOS port by Jarmo Laakkonen jami@dlc.fi    */
  6.  
  7. #include "common.h"
  8. #include "split.h"
  9. #include "join.h"
  10. #include "repair.h"
  11.  
  12. /* This is a versionstring for use with the Amiga-program "version" */
  13. #ifndef __PPC__
  14. const char Version[]="$VER: Sploiner 1.01 ("__DATE__" "__TIME__")\0";
  15. #else
  16. const char Version[]="$VER: SploinerPPC 1.01 ("__DATE__" "__TIME__")\0";
  17. #endif
  18.  
  19. char *prgname;
  20.  
  21. int main(int argc, char *argv[])
  22. {
  23.   prgname = *argv++;
  24.   if (argc-- < 2) usage();
  25.  
  26.   if (strcmp(*argv,"split")==0)
  27.     split(--argc, ++argv);
  28.   else if (strcmp(*argv,"join")==0)
  29.     join(--argc, ++argv);
  30.   else if (strcmp(*argv,"repair")==0)
  31.         {
  32.             #ifdef __WARPOS__
  33.             printf("Repair not available in WarpOS version!\n");
  34.             exit(1);
  35.             #else
  36.         repair(--argc, ++argv);
  37.             #endif
  38.         }
  39.   else if (strcmp(*argv,"example")==0)
  40.     usage_example();
  41.   else usage();
  42.   return 0;
  43. }
  44.  
  45. int FileSize(FILE *fp)
  46. {
  47.   long size, pos=ftell(fp);
  48.   
  49.   fseek(fp,0,SEEK_END);      /* Goto EOF */
  50.   size=ftell(fp);            /* Read position */
  51.   fseek(fp,pos,SEEK_SET);    /* Goto old position */
  52.   return(size);
  53. }
  54.  
  55. void OutputName(char *name, char *outfile)
  56. {
  57.   int ext;
  58.   
  59.   for(ext=0 ; ((outfile[ext]=name[ext]) != '\0') ; ext++);
  60.  
  61.   outfile[ext]='.';
  62.   outfile[ext+1] = '0';
  63.   outfile[ext+2] = '0';
  64.   outfile[ext+3] = '0';
  65.   outfile[ext+4] = '\0';
  66. }
  67.  
  68.